package com.itheima.controller;

import com.itheima.common.CommonResult;
import com.itheima.common.PageInfo;
import com.itheima.service.DishService;
import com.itheima.vo.PhoneDishVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author YangJiaHao
 */
@RestController
@RequestMapping("/dish")
public class DishController {
    @Autowired
    private DishService dishService;

    @GetMapping("/list")
    public CommonResult list(String categoryId,Integer status){
        List<PhoneDishVo> phoneDishVos = dishService.list(categoryId,status);
        return CommonResult.success(phoneDishVos);
    }
}
